Skip to content

fix(pip_compile): Forward target compatibility to *.update#3787

Merged
aignas merged 2 commits into
bazel-contrib:mainfrom
castler:target_compatible_with_for_pip_compile_update
May 20, 2026
Merged

fix(pip_compile): Forward target compatibility to *.update#3787
aignas merged 2 commits into
bazel-contrib:mainfrom
castler:target_compatible_with_for_pip_compile_update

Conversation

@castler
Copy link
Copy Markdown
Contributor

@castler castler commented May 18, 2026

With this changset we enable users to build and test //... in their repositories also with platforms that do not support Python.

For example, a user might use Python for tooling and automation, where he develops only on Linux. Then he could set target_compatible_with to @platforms//os:linux, but he uses C++ for his production code. Where he crosscompiles to other operating systems (e.g. QNX, TriCore).

In order to enable this, we need to forward target_compatible_with also to the also to the also to the*.update` target.

@castler castler requested review from aignas and rickeylev as code owners May 18, 2026 06:41
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request modifies pip_compile.bzl to pass the target_compatible_with attribute to the .update target. Feedback indicates that using None as a default value for this attribute will trigger a Bazel type error, as a list is expected. Additionally, the reviewer suggested forwarding the testonly attribute to ensure the target remains compatible with its dependencies.

Comment thread python/private/pypi/pip_compile.bzl Outdated
@castler castler force-pushed the target_compatible_with_for_pip_compile_update branch from 9b046e8 to 3620848 Compare May 18, 2026 06:45
Comment thread python/private/pypi/pip_compile.bzl
@castler castler force-pushed the target_compatible_with_for_pip_compile_update branch from fe0eb48 to 95fcfbb Compare May 20, 2026 04:46
With this changset we enable users to build and test `//...` in their
repositories also with platforms that do not support Python.

For example, a user might use Python for tooling and automation, where
he develops only on Linux. Then he could set `target_compatible_with` to
`@platforms//os:linux`, but he uses C++ for his production code. Where
he crosscompiles to other operating systems (e.g. QNX, TriCore).

In order to enable this, we need to forward `target_compatible_with`
also to the ` also to the  also to the `*.update` target.
Comment thread CHANGELOG.md Outdated
@aignas aignas enabled auto-merge May 20, 2026 06:16
@aignas aignas changed the title fix: pip_compile: Forward target compatibility to *.update fix(pip_compile): Forward target compatibility to *.update May 20, 2026
@aignas aignas added this pull request to the merge queue May 20, 2026
Merged via the queue into bazel-contrib:main with commit 61cfa88 May 20, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants